package data.board;

import data.Color;
import data.pieces.Piece;

public class Square {
	private final int x;
	private final int y;
	private final char row;
	private final char column;
	private final Color color;
	private Piece piece;

	public Square(int x, int y) {
		super();

		this.x = x;
		this.y = y;
		this.row = (char) ('1' + x);
		this.column = (char) ('A' + y);
		this.color = ((x + y) % 2 == 0) ? Color.WHITE : Color.BLACK;
	}

	public static void main(String[] args) {
		Square s = new Square(0, 1);
		System.out.println("" + s.getRow() + s.getColumn() + s.getColor());
	}

	public char getRow() {
		return row;
	}

	public char getColumn() {
		return column;
	}

	public Color getColor() {
		return color;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public String getCoordinates() {
		return "" + column + row;
	}
	
	public void setPiece(Piece p){
		piece = p;
	}

	public Piece getPiece() {
		return piece;
	}
}
